Computer memory generally falls into two categories, called random access memory (RAM) and mass storage (disk). RAM is available in different forms, usually in a semiconductor integrated circuit (IC) package, and is sometimes referred to as a computer's “main memory.” Access to memory locations in a RAM device takes place electronically, relying on connections built into the device at the time of manufacture, as well as a corresponding addressing scheme. Disk storage is also available in many forms, a common form being magnetic storage media, such as in a computer “hard disk,” which uses an electro-mechanical read/write head that moves over a surface of the hard disk to access various portions of the hard disk.
In a RAM device, the order of access to different portions of the storage device does not affect the speed of the access. In other types of memory, e.g. magnetic storage, the speed at which information can be accessed depends on its location in the storage device because physical (mechanical) movement of the read/write head is required to access various parts of the storage device. Disk performance suffers when not accessing the portions of the device sequentially, because this requires more movement of the read/write head. Consequently, reading and writing to RAM is usually much faster than the equivalent operations on a disk.
Most computers use a combination of RAM and disk storage. RAM generally provides temporary storage for instructions and data needed during operation, while the normally larger and less expensive disk is used to store programs and data that are not in use. The computer's processors, e.g. the central processing unit (CPU), and the operating system, manage and access information in RAM. In normal operation, the information needed by the operating system and overlying software, e.g. application programs, is pulled up from storage in a disk and placed into addressable memory locations in RAM. Information may be returned to a disk when it is no longer needed to make room in RAM for other information.
One aspect of computer memory and memory device operation considers the potential for data loss or corruption in the event that more than one user or computer program or process (“thread”) requests access to the same data or memory block at the same time. A thread requiring data in a memory block sends a request through the operating system to the driver or device manager responsible for providing threads with access to memory. Requests to read, write, or otherwise use a portion of memory are generally referred to as requests to “touch” the portion of memory.
To protect data from loss and corruption, when a memory block is in use, that portion is “locked” using a locking mechanism that prevents threads from accessing the memory block when it is in use by another thread. When the thread having access to the block is finished using the block, it is unlocked, and a thread waiting to use it can access the portion of memory, in turn locking the block while in use. By using the locking scheme, each portion of memory is either unlocked and available, or locked and unavailable, avoiding the possibility of two programs altering the same data and creating a conflict as to the proper content of the portion of memory containing the data. This constant locking and unlocking and use of locks on all memory blocks or pages is costly in computing resources, but has been viewed as important, given the adverse consequences of not protecting data against this potential conflict.
Another aspect of computer memory devices is the notion of volatility. As explained briefly above, RAM is an electronic semiconductor device. Unless power is maintained to the RAM device to refresh and hold its semiconductor logic devices in a same state, the state of the semiconductor logic will be uncertain upon restart, therefore losing the information stored in RAM at the time of shutdown. As such, RAM is most commonly “volatile,” as the information in RAM is subject to loss upon powering down the device. Disks usually store information in permanent, persistent, non-volatile form, such as by encoding magnetic regions of a disk or tape in a way that can tolerate loss of electrical power without losing the data stored in a disk.
To enhance the performance (speed) of computers, systems using RAM have been designed to emulate a disk partition in the computer's RAM. This is generally referred to as a “RAM disk,” implying that the RAM is effectively being used as a disk storage device. RAM disks provide file access in a way analogous to file access on a disk. Software is used to create and manage the RAM disk so that the operating system of the computer treats that portion of RAM as it would treat an actual disk drive connected to the computer. Since RAM access is much faster than disk access, RAM disks are especially useful to improve the speed of applications that perform frequent memory access operations.